package com.brillilab.service.core.message;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.po.message.Message;
import com.brillilab.domain.vo.message.MessageDetailVo;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;

import java.util.List;

public interface IMessageService {
    Message selectById(Long messageId);

    boolean update(Message message);

    boolean insert(Message message);

	PageVo<Message> getMessageList(Long userId, Integer isRead, int pageNum, int pageSize);

	List<Message> getTopUnReadMsgList(Integer top,Long userId, List<Integer> msgTypeList);

    PageVo<Message> getPageUnReadMsgList(Long userId, List<Integer> msgTypeList,int pageNum, int pageSize);

	boolean allRead( Long userId);
	
	/**
	 * 审阅已读
	 * @return
	 */
	void reviewRead(MessageTypeEnum typeEnum, Long referId);

	/**
	 * 获取用户未读消息条数
	 * @param userId
	 * @return
	 */
	Integer getUnReadMsgCount(Long userId);

	List<Message> insertBatch(List<Message> messages);

    MessageDetailVo getMessageDetail(Long messageId,Long labId,Long labMemberId);

    boolean canRead(Message message,Long userId);

	Message selectOne(Long referId,Long receiverId);

	Message getMessage(Long messageId,Long userId);
}
